<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="https://www.thymeleaf.org/">

<!--公共依赖头-->
<head th:fragment="commonHead(title,links,styles)">
    <title th:replace="${title}">GoblinCwl</title>
    <!--网站图标-->
    <link rel="shortcut icon" th:href="@{/images/favicon.ico}" type="image/x-icon"/>
    <!--BootStrap-->
    <link th:href="@{/webjars/bootstrap/3.4.1/css/bootstrap.min.css}" rel='stylesheet' type='text/css'/>
    <link th:href="@{/webjars/bootstrap-table/1.16.0/bootstrap-table.css}" rel='stylesheet' type='text/css'/>
    <link th:href="@{/webjars/bootstrap-select/1.13.18/css/bootstrap-select.css}" rel='stylesheet' type='text/css'/>
    <!-- 自定义主题文件 -->
    <link th:href="@{/css/dashboard.css}" rel="stylesheet">
    <link th:href="@{/css/style.css}" rel='stylesheet' type='text/css'/>
    <!-- 其他-->
    <link th:href="@{/css/xtiper/xtiper.css}" rel="stylesheet" type="text/css" media="all"/>
    <!--自定义-->
    <link rel="stylesheet" th:href="@{/css/goblincwl/common.css}">
    <link rel="stylesheet" th:href="@{/css/goblincwl/width.css}">

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="keywords" content="GoblinCwl,陈威龙"/>
    <meta name="baidu-site-verification" content="code-tpkakEwQWN"/>

    <!--隐藏滚动条-->
    <style>
        ::-webkit-scrollbar {
            display: none; /* Chrome Safari */
        }

        html body div {
            scrollbar-width: none; /* firefox */
            -ms-overflow-style: none; /* IE 10+ */
        }
    </style>

    <!--网页小地图-->
    <style>
        #map {
            position: fixed;
            top: 0;
            right: 0;
            width: 80px;
            height: 100%;
            z-index: 100;
        }
    </style>

    <!--可扩展块-->
    <th:block th:replace="${links}"/>
    <th:block th:replace="${styles}"/>
</head>
<!--公共依赖尾-->
<div th:fragment="commonFoot(scripts)">
    <!-- jQuery (必要的JavaScript插件) -->
    <script th:src="@{/webjars/jquery/3.6.0/jquery.min.js}"></script>
    <script th:src="@{/webjars/jquery-cookie/1.4.1-1/jquery.cookie.js}"></script>
    <!-- Bootstrap -->
    <script th:src="@{/webjars/bootstrap/3.4.1/js/bootstrap.min.js}"></script>
    <script th:src="@{/webjars/bootstrap-table/1.16.0/bootstrap-table.min.js}"></script>
    <script th:src="@{/webjars/bootstrap-table/1.16.0/locale/bootstrap-table-zh-CN.min.js}"></script>
    <script th:src="@{/webjars/bootstrap-paginator/1.0.2/build/bootstrap-paginator.min.js}"></script>
    <script th:src="@{/webjars/bootstrap-select/1.13.18/js/bootstrap-select.min.js}"></script>
    <script th:src="@{/webjars/bootstrap-select/1.13.18/js/i18n/defaults-zh_CN.js}"></script>
    <!-- 其他 -->
    <script th:src="@{/js/xtiper/xtiper.js}" type="text/javascript"></script>
    <!--自定义-->
    <script th:src="@{/js/goblincwl/common.js}" type="text/javascript"></script>

    <!--变量集-->
    <script>
        ctx = '[[@{/}]]' == '/' ? '' : '[[@{/}]]';
        isHttps = 'https:' === document.location.protocol;
        url = '[[ ${#httpServletRequest.getRequestURL()}]]';
        if (isHttps) {
            url = url.replace('http', 'https');
        }
    </script>

    <!--管理模块自动显示-->
    <script>
        $(function () {
            addManagerUl();
        })

        //管理模块头部菜单
        const managerLi =
            "<li id='managerLi'>" +
            "    <a href='/manager'>" +
            "        <i class='glyphicon glyphicon-cog'></i>管理" +
            "    </a>" +
            "</li>";

        //追加ManagerUl
        function addManagerUl() {
            let token = localStorage.getItem("access_token");
            if (token != null && token !== '') {
                ajaxHttp({
                    url: ctx + "/manager/check",
                    success: function (res) {
                        if (res.data) {
                            if (token != null && token != "") {
                                let $managerLi = $('#managerLi');
                                if ($managerLi.length && $managerLi.length > 0) {
                                } else {
                                    //不存在则添加
                                    $("#topHeaderUl").append(managerLi)

                                }
                            }
                            //全站cookie
                            $.cookie("Authorization", token, {path: '/'});
                        } else {
                            localStorage.removeItem("access_token");
                        }
                    }
                })
            }
        }
    </script>

    <!--页面加载后返回顶部-->
    <script type="application/x-javascript"> addEventListener("load", function () {
        setTimeout(function () {
            window.scrollTo(0, 1);
        }, 0);
    }, false);
    </script>

    <!--网页小地图-->
    <canvas id="map"></canvas>
    <script th:src="@{/js/pageMap/pagemap.min.js}"></script>
    <script>
        pagemap(document.querySelector('#map'));
    </script>

    <!--可扩展块-->
    <th:block th:replace="${scripts}"/>
</div>
<!-- 左侧侧边栏 -->
<div th:fragment="leftSiderBar()" class="col-sm-3 col-md-2 sidebar">
    <div class="sidebar_top">
        <h1>GoblinCwl</h1>
        <img th:src="@{/images/profile.jpg}" alt=""/>
    </div>
    <div class="details">
        <h3>世事一场大梦，</h3>
        <h3>人生几度秋凉。</h3>


    </div>
    <div class="clearfix"></div>
</div>
<!-- 顶部导航 -->
<div th:fragment="topHeader()" class="details_header" id="topHeader">
    <ul id="topHeaderUl">
        <li>
            <a href="/">
                <i class="glyphicon glyphicon-home" aria-hidden="true"></i>首页
            </a>
        </li>
        <li>
            <a href="/resume">
                <i class="glyphicon glyphicon-file" aria-hidden="true"></i>简历
            </a>
        </li>
        <li>
            <a href="/blog">
                <i class="glyphicon glyphicon-list" aria-hidden="true"></i>博客
            </a>
        </li>
        <li>
            <a href="/service">
                <i class="glyphicon glyphicon-star" aria-hidden="true"></i>功能
            </a>
        </li>
    </ul>
</div>